<html>
    <head>
        <title>
            Fuzzing Options:
        </title>
        <script src="diff_match_patch/diff_match_patch.js"><!-- Myers Diff Algorithm --></script>
        <script src="jquery/jquery-1.7.2.js"></script>
        <script src="Fuzzer.js"></script>
    </head>

    <body style="background-color:#FAFAFA;">
        <h1>
            Request Fuzzer:
        </h1>
        <h2>
            <a id = "forge_panel_link" href = "">Forge Options</a>
        </h2>
        

        URL: <input type = "text" id="request_url" readonly = "readonly" /><br /><br />

        <div id = "header_container" style =  "border-color:#777777; border-width:1px; border-style: solid; display:table;">
            <div id = "header_fuzzer_label">
            </div>
            <div id = "header_name_fuzzing">
                <table id = "header_table">
                    
                </table>
            </div>
            
        </div>
        <br/>

        <div id = "cookie_container" style =  "border-color:#777777; border-width:1px; border-style: solid; display:none; display:table;">
            <div id = "cookie_fuzzer_label">
                Cookies:
            </div>
            <div id = "cookie_name_fuzzing">
                <table id = "cookie_table">
                    
                </table>
            </div>
        </div>
        <br/>

        <div id = "parameter_container" style =  "border-color:#777777; border-width:1px; border-style: solid; display:table; ">
            <div id = "parameter_fuzzer_label">
            </div>

            <div id = "parameter_name_fuzzing">
                <table id = "parameter_table">
                    
                </table>
            </div>
        </div>
        <br/>

        <div id = "fuzzer_panel_div" style =  "border-color:#777777; border-width:1px; border-style: solid; display:table;">
            <h2>
                Fuzzer Configuration:
            </h2>
            <p>
                <input type = "checkbox" id = "urlencode_param_check" checked = "checked" /> URLEncode fuzzing values for parameters<br/>
                <input type = "checkbox" id = "urlencode_cookie_check"  /> URLEncode fuzzing values for cookies
            </p>
            <p>
                <h3>
                    Fuzzing mode:
                </h3>
                <input type="radio" name = "fuzzing_mode" id = "fuzzing_mode_integer_input" value = "integer" /> Integer fuzzer
                <br />
                <input type="radio" name = "fuzzing_mode" id = "fuzzing_mode_character_seq_input" value = "character_seq"  /> Character sequence fuzzer
                <br />
                <input type="radio" name = "fuzzing_mode" id = "fuzzing_mode_character_input" value = "character"  /> Character fuzzer
                <br />
                <input type="radio" name = "fuzzing_mode" id = "fuzzing_mode_xss_input" value = "xss"  /> XSS fuzzer
                <br />
                <input type="radio" name = "fuzzing_mode" id = "fuzzing_mode_sql_input" value = "sql"  /> SQL injection fuzzer
                <br />
            </p>
            <h3>
                    Fuzzing values:
            </h3>
            <div id = "fuzzer_config_panel">
                <font id ="select_fuzzing_mode_font" color = "red">---Select fuzzing mode and target---</font>
                <div id = "integer_fuzzer_config" style = "display:none;">
                    <table style = "border-color:#777777; border-width:1px; border-style: solid;">
                        <tr>
                            <td colspan = "4">
                                <font color = "green">Integer sequence generator:</font>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Start with:
                            </td>
                            <td>
                                <input type ="number" id="integer_start" value = "0"/>
                            </td>
                            <td>
                                Finish with:
                            </td>
                            <td>
                                <input type = "number" id = "integer_finish" value = "100"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <input type = "radio" id = "integer_increment" name = "integer_increment_decrement" value = "inc" checked = "checked"/>&nbsp;Increment
                            </td>
                            <td>
                                <input type = "radio" id = "integer_decrement" name = "integer_increment_decrement" value = "dec"/>&nbsp;Decrement
                            </td>
                            <td>
                                Increment/Decrement by:
                            </td>
                            <td>
                                <input type = "number" id = "integer_step" value = "1"/>
                            </td> 
                        </tr>
                    </table>
                </div>
                <div id = "character_seq_fuzzer_config" style = "display:none;">
                    <table style = "border-color:#777777; border-width:1px; border-style: solid;">
                        <tr>
                            <td colspan = "4">
                                <font color = "green">Unicode character sequence generator:</font>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Start with 
                            </td>
                            <td>
                                <input type = "number" value = "0" id = "character_seq_start"/>
                            </td>
                            <td>
                                Finish with 
                            </td>
                            <td>
                                <input type = "number" value = "1000" id = "character_seq_finish"/> characters
                            </td>
                        </tr>
                        <tr>
                            <td>
                                The character:
                            </td>
                            <td>
                                <input type = "number" value = "65" id = "character_seq_character" max = "65535" /><br/> <!-- 65535  because javascripts fromCharCode, charCodeAt supports only this range-->
                                <input type = "text" value = "A" readonly = "readonly" id = "character_seq_character_display" style = "background-color:#FFCC99"/>
                            </td>
                            <td>
                                Append
                            </td>
                            <td>
                                <input type = "number" id = "character_seq_append" value = "1"/>&nbsp;characters
                            </td>
                        </tr>
                    </table>
                </div>
                <div id = "character_fuzzer_config" style = "display:none;">
                    <table style = "border-color:#777777; border-width:1px; border-style: solid;">
                        <tr>
                            <td colspan = "3" >
                                <font color = "green">Unicode character generator:</font>
                                <!-- Use javascript fromCharCode() and UTF-16 -->
                            </td>
                            <td>
                                <input type = "button" id = "set_to_ascii_button" value = "ASCII only" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Start with
                            </td>
                            <td>
                                <input type = "number" id = "character_start" value = "0" min = "0" max = "65535" />
                            </td>
                            <td>
                                Finish with
                            </td>
                            <td>
                                <input type = "number" id = "character_finish" value = "65535" min = "0" max = "65535" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Start character
                            </td>
                            <td>
                                <input type = "text" maxlength = "3" readonly = "readonly" id="chracter_display_start" style = "background-color:#FFCC99"/>
                            </td>
                            <td>
                                Finish character
                            </td>
                            <td>
                                <input type = "text" maxlength = "3" readonly = "readonly" id="character_display_finish" style = "background-color:#FFCC99"/>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id = "xss_fuzzer_config" style = "display:none;">
                    XSS vectors:<br/>
                    <!-- write all examples from xss cheat sheet in textareas with name attribute set here, then loop through all textareas and their values via the name attribute
                         For each xss vector, load the page that is fuzzed in iframe like in SessionIdMenu. When alert("XSS") is called, loop is interrupted and successful vector is displayed
                    -->
                    <font color = "green" id = "xss_vector_counter_font"></font><br />
                    <iframe id = "xss_vectors_iframe" src = "XSSCheatSheetVectors.html" style = "width:500px; height:500px;">
                    </iframe>
                </div>
                <div id = "sql_fuzzer_config" style = "display:none;">
                    SQL injection vectors:<br />
                    <!-- Same as for xss fuzzer, but uses sql injection cheat sheet-->
                    <font color = "green" id = "sql_vector_counter_font"></font><br />
                    <iframe id = "sql_vectors_iframe" src = "SQLInjectionCheatSheetVectors.html" style = "width:500px; height:500px;">
                    </iframe>
                </div>
            </div>
        </div>
        <input type = "button" value = "Start fuzzing" id = "start_fuzzing_button" />
        <input type = "button" value = "Stop fuzzing" id = "stop_fuzzing_button"  />
        <a href = "FuzzingRunBrowser.html" target ="_blank" >Browse recent fuzzing runs</a>
        <div id = "result_counter_div"></div>
        <br />
        <div id = "fuzzing_results_div" style =  "border-color:#777777; border-width:1px; border-style: solid;display:none;">
            <h2>Fuzzing Results:</h2>
            <div id = "fuzzing_results_filter" style = "display:none;">
                <input type = "radio" name="filter_include_exclude" id = "filter_include"/>Include
                <input type = "radio" name="filter_include_exclude" id = "filter_exclude" checked = "checked"/>Exclude
                <input type = "text" id = "filter_input"/>
                <input type = "button" value = "Filter" id = "filter_button" />
            </div>
            <br />
            <div id = "fuzzing_results_list" >
                <!-- display results here-->
            </div>
        </div>
    </body>
</html>